<?php

namespace app\api\controller;

use app\api\model\CardSlide;
use think\Controller;
use think\Request;

class Slide extends Base
{
    //商城轮播
    public function index()
    {
        $data = CardSlide::getList();
        return self::apiResp($data);
    }

	//点击轮播图
	public function click()
	{
		$link_type = input('link_type');
		$id = input('id');
		$appletid = input('appletId');
		if($link_type == 'group')
		{ //加载主题
			$this->redirect('api/CardGroup/getGroup',['id'=>$id,'appletId' => $appletid],302);
		}
		elseif($link_type == 'detail')
		{ //加载卡券
            $this->redirect('api/Card/getById',['id'=>$id,'appletId' => $appletid],302);
		}
	}
}
